apiready = function(){
seajs.use(['../../V',"../../api","../../jquery","../../app","../../service"],function(V,$api,$,app,service){
	var vm = {
		el: '.container',
	  	data: {

	  	},
	  	mounted:function() {
	  	},
    	methods:{
        shop: function(){
          api.openWin({
              name: 'person',
              url: '../buy_person/person.html',
							reload: true
           });
        },
        myShop: function(){
          var appId = app.appid;
          var unionid = $api.getStorage("shop_unionid");
					var userid = $api.getStorage("user").data.id;

					var that = this;
					app.ajax(
						service['shopDetail'],
						{
							data: {
								values: {
									appid: appId,
									userid: userid
								}
							}
						},
						function (res) {
							if (res.code == 0) {
								console.log("res.data: "+JSON.stringify(res.data))
								if (res.data.length == 0) {
									api.openWin({
				              name: 'shop',
				              url: './shop.html',
											reload: true
				           });
								} else {
									console.log("first_shop_unionid: "+unionid)
									that.toMyShop();
								}
							}
						}
					);
        },

				toMyShop: function () {
					api.openWin({
						name: 'my_shop',
						url: '../my_shop/my_shop.html',
						reload: true
					});

      },

		},
		created: function(){

		}
  };

	var even = function() {}
	var newVue = new Vue(vm);
	even();
});
}
